<?php
/**
 * 威富通回调模型(支付宝支付)
 */
class Notify_swiftpass_alipay_model extends BS_Model
{
	//  根据订单Id查询回调/支付宝
    public function getNotifyByOrderId($orderid)
    {
        $this->db->select('*');
        $this->db->from('notify_swiftpass_alipay');
        $this->db->where('out_trade_no', $orderid);
        $this->db->limit(1, 0);
        $query = $this->db->get();
        return $query->num_rows() == 0 ? null : $query->row_array();
    }

    //添加到支付回调表/支付宝
    public function addNotifyByData($data)
    {
        $query = $this->db->insert('notify_swiftpass_alipay', $data);
        return $this->db->insert_id();
    }	
}